# -*- coding: utf-8 -*-
from db.mysql import MysqlClient
from common.helper import Helper
from itertools import product
name = "易安住院无忧成人保障尊享款"
mysql = MysqlClient()

plan = {
    "planA": {
        "year": ["18-47"],
        "days": ["1y"],
        "accident_death": ["100000"],
        "accident_medical": ["10000"],
        "accident_hospital": ["50/天"],
        "disease_hospital": ["10000"],
        "price": ["199.00"]
    },
    "planB": {
        "year": ["18-47"],
        "days": ["1y"],
        "accident_death": ["200000"],
        "accident_medical": ["20000"],
        "accident_hospital": ["50/天"],
        "disease_hospital": ["20000"],
        "price": ["269.00"]

    }

}
for k in plan:
    for v in product( plan[k]["year"],plan[k]["days"],plan[k]["accident_death"],plan[k]["accident_medical"],plan[k]["accident_hospital"],plan[k]["disease_hospital"],plan[k]["price"]):
        data = Helper.formatProductInfo( plan[k],v )
        data["name"] = name
        data["company"] = "易安保险"
        Helper.mergeTable(name,mysql,data )